<template>
  <!-- 保留公共导航栏 -->
  <el-menu
      mode="horizontal"
      :ellipsis="false"
      class="nav-menu"
      background-color="#2c3e50"
      text-color="#fff"
      active-text-color="#409EFF"
  >
    <el-menu-item index="0" class="logo-item" @click="$router.push('/')">
      <img src="@/assets/logo.png" class="logo" />
      <span>联邦学习平台</span>
    </el-menu-item>
    <div class="flex-grow" />
    <el-menu-item index="1" @click="$router.push('/')">首页</el-menu-item>
    <el-menu-item index="2" @click="$router.push('/tasks')">任务大厅</el-menu-item>
  </el-menu>

  <!-- 路由视图容器 -->
  <router-view></router-view>
</template>

<script setup>
// 可保留全局状态逻辑（如有）
</script>

<style>
/* 保留全局样式 */
.nav-menu {
  padding: 0 20px;
}

.logo-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  height: 40px;
}

.flex-grow {
  flex-grow: 1;
}
</style>